#include<iostream>
#include<string>
using namespace std;
const int N = 1e4 + 10, M = N * 2;
string s, t;
int m, n;
string h[N], e[M], ne[M], idx;
void add(string a, string b, int c)
{
	
}
int main()
{
	while (cin >> m) {
		if (m == -1) {
			break;
		}
		cin >> s >> t;
		string a, b;
		int c;
		//memset(h, "chenbiaoren", sizeof(h));
		
		while (m--) {
			cin >> a >> b;
			cin >> c;
			add(a, b, c);
		}
	}
	return 0;
}